package service;

import dao.Album;
import dao.AlbumDao;
import dao.AlbumDaoImpl;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: eee pc
 * Date: 04.03.13
 * Time: 13:23
 * To change this template use File | Settings | File Templates.
 */
public class AlbumServiceImpl implements AlbumService {
    private static final AlbumService INSTANCE = new AlbumServiceImpl();
    private static final AlbumDao albumDao = AlbumDaoImpl.getInstance();

    private AlbumServiceImpl() {

    }

    public static AlbumService getInstance() {
        return INSTANCE;
    }

    @Override
    public List<Album> getAlbums() {
        List<Album> albums = albumDao.getAlbums();
        return albums;
    }

    @Override
    public Album getAlbumByAlbumId(Long id) {
        Album album = albumDao.getAlbumByAlbumId(id);
        return album;
    }

    public List<Album> getAlbumsByArtistId(Long id) {
        List<Album> albums = albumDao.getAlbumsByArtistId(id);
        return albums;
    }
}
